<#assign className = table.className>
<#assign classNameLower = className?uncap_first>

import me.luger.core.dao.nutz.service.CurdService;
import me.luger.core.dao.nutz.entity.page.Pagination;
import me.luger.core.dao.nutz.entity.page.DataTableRequest;
import me.luger.core.dao.nutz.entity.page.DataTableResult;
import me.luger.project.${projectName}.modules.${moduleName}.dao.${className}Dao;
import me.luger.project.${projectName}.modules.${moduleName}.entity.${className};
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class ${className}Service extends CurdService<${className},${table.pkColumn.simpleJavaType}> {
    @Autowired
    private ${className}Dao ${classNameLower}Dao;


    @Override
    public ${className} insert(${className} ${classNameLower}) {
        return ${classNameLower}Dao.insert(${classNameLower});
    }

    @Override
    public int delete(${table.pkColumn.simpleJavaType}... ids) {
        return ${classNameLower}Dao.delete(ids);
    }

    @Override
    public int update(${className} ${className}) {
        return ${classNameLower}Dao.update(${className});
    }

    @Override
    public int updateIgnoreNull(${className} ${className}) {
        return ${classNameLower}Dao.updateIgnoreNull(${className});
    }


    @Override
    public ${className} getById(${table.pkColumn.simpleJavaType} aLong) {
        return ${classNameLower}Dao.getById(aLong);
    }

    @Override
    public List<${className}> listAll() {
        return ${classNameLower}Dao.listAll();
    }

    @Override
    public Pagination<${className}> listPage(int pageNumber, int pageSize){
        return ${classNameLower}Dao.listPage(pageNumber,pageSize);
    }

    @Override
    public DataTableResult<${className}> data(DataTableRequest dataTableRequest) {
        return ${classNameLower}Dao.data(dataTableRequest);
    }
}
